<?php

namespace App\Domain\ApplicationCenter\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CreateAppPost extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required|string',
            'icon' => 'required|string',
            'language_arousal' => 'required',
            'startup_parameter' => 'required',
            'download_url' => 'required',
            'description' => '',
            'sort' => '',
        ];
    }

    public function messages()
    {
        return [
            'name' => '应用名称必填',
            'icon' => '应用图标未上传',
            'language_arousal' => '语音唤醒词必填',
            'startup_parameter' => '启动参数必填',
            'download_url' => '下载地址必填',
        ];
    }
}
